package umt.cs.cs241.assignment2.r_2_14;

public class Formula {

	private int a;
	private int b;
	private int c;
	
	public Formula(int a, int b, int c){
		this.a = a;
		this.b = b;
		this.c = c;
	}
	
	/**
	 * Determines if a + b = c
	 * 
	 * @return boolean - True if formula is correct for the given values
	 */
	public boolean formula_1(){
		
		boolean correctFormula;
		
		if( (a+b) == c ){
			correctFormula = true;
		}else{
			correctFormula = false;
		}
		
		return correctFormula;
		
	}
	
	/**
	 * Determines if a = b - c
	 * @return boolean - True if formula is correct for the given values
	 */
	public boolean formula_2(){
		
		boolean correctFormula;
		
		if( a == (b-c) ){
			correctFormula = true;
		}else{
			correctFormula = false;
		}
		
		return correctFormula;
		
	}
	
	/**
	 * Determines if a * b = c
	 * 
	 * boolean - True if formula is correct for the given values
	 */
	
	public boolean formula_3(){
		
		boolean correctFormula;
		
		if( (a * b) == c ){
			correctFormula = true;
		}else{
			correctFormula = false;
		}
		
		return correctFormula;
		
	}
	
	public void printResults(){
		
		System.out.println("a + b = c " + this.formula_1());
		System.out.println("a = b - c " + this.formula_2());
		System.out.println("a * b = c " + this.formula_3());
		
	}
	
}
